const mongoose = require('mongoose')
const User = mongoose.Schema({
  username: String,
  password: {
    type: String,
    select: false,
    set(val) {
      return require('bcrypt').hashSync(val, 10)
    }
  },
}, {
  timestamps: true,
})
module.exports = mongoose.model('User', User)